﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SeleniumEditUnderDiv.cs" company="">
//   
// </copyright>
// <summary>
//   The selenium edit under div.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace UITest.Selenium.SeleniumControls.HtmlControls
{
    using OpenQA.Selenium;

    using UITest.Selenium.SeleniumContext;

    /// <summary>
    ///     The selenium edit under div.
    /// </summary>
    public class SeleniumEditUnderDiv : SeleniumEdit
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="SeleniumEditUnderDiv"/> class.
        /// </summary>
        /// <param name="seleniumContext">
        /// The selenium context.
        /// </param>
        /// <param name="findBy">
        /// The find by.
        /// </param>
        public SeleniumEditUnderDiv(SeleniumContext seleniumContext, By findBy)
            : base(seleniumContext, findBy)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SeleniumEditUnderDiv"/> class.
        /// </summary>
        /// <param name="seleniumContext">
        /// The selenium context.
        /// </param>
        /// <param name="webElement">
        /// The web element.
        /// </param>
        public SeleniumEditUnderDiv(SeleniumContext seleniumContext, IWebElement webElement)
            : base(seleniumContext, webElement)
        {
        }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// The get web element.
        /// </summary>
        /// <returns>
        /// The <see cref="IWebElement"/>.
        /// </returns>
        public override IWebElement GetWebElement()
        {
            IWebElement parent = this.FindElement();

            return parent.FindElement(By.TagName("input"));
        }

        #endregion
    }
}